home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Widget Wizard.dir / WidgtBehaviors_8_button 2 picts manual.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  1.2 KB  |  53 lines

  1. property UpCM, DownCM, button_active
  2.  
  3. on getPropertyDescriptionList
  4.   set description to [:]
  5.   addProp(description, #DownCM, [#default: "Down", #format: #bitmap, #comment: "Pict for Down:"])
  6.   return description
  7. end
  8.  
  9. on getBehaviorDescription
  10.   return "Button, auto set up pict, switch pict down"
  11. end
  12.  
  13. on getAssocMembers
  14.   set myPropList to [DownCM]
  15.   return myPropList
  16. end
  17.  
  18. on beginSprite me
  19.   set the UpCM of me to the member of sprite the spriteNum of me
  20.   set the button_active of me to 0
  21.   puppetSprite(the spriteNum of me, 1)
  22. end
  23.  
  24. on endSprite me
  25.   puppetSprite(the spriteNum of me, 0)
  26. end
  27.  
  28. on mouseDown me
  29.   set the member of sprite the spriteNum of me to member the DownCM of me
  30.   set the button_active of me to 1
  31. end
  32.  
  33. on mouseUp me
  34.   set the member of sprite the spriteNum of me to member the UpCM of me
  35.   set the button_active of me to 0
  36. end
  37.  
  38. on mouseUpOutSide me
  39.   set the button_active of me to 0
  40. end
  41.  
  42. on mouseLeave me
  43.   if the button_active of me then
  44.     set the member of sprite the spriteNum of me to member the UpCM of me
  45.   end if
  46. end
  47.  
  48. on mouseEnter me
  49.   if the button_active of me then
  50.     set the member of sprite the spriteNum of me to member the DownCM of me
  51.   end if
  52. end
  53.